package com.kingsoft.miot.bridge.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 * 权限拦截器
 * 
 * @author melody
 *
 */
@Service
public class AccessInterceptor extends HandlerInterceptorAdapter {

//	@Autowired
//	RedisUtil redisUtil;

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		if (handler instanceof HandlerMethod) {
			request.getMethod();
			response.sendRedirect("/test/controller");
			return true;
		}
		return false;
	}
}
